<?php
/**
 * Created by PhpStorm.
 * User: a
 * Date: 2016/8/30
 * Time: 16:32
 */

namespace sw\server;
use sw\model\SwUser;


class Create
{
    public static function user($username)
    {
        $user = new SwUser();
        $user->username = $username;
        $user->password = md5(md5("123456") . "12345678");
        $user->created_at = time();
        $user->updated_at = time();
        $user->is_delete = 0;
        $user->is_manager = 1;
        if ($user->save() == false ){
            return "create user failed";
        }
        return "create user success";
    }
}